<?php
    include_once("../../service/commentService.php");
    include_once("../../service/userService.php");
    
    $spro_id = $_GET["pro_id"];
    $page = $_GET["p"];
    $record_per_page = 5;
    $start_record = ($page * $record_per_page) - 4;
    $bids = getBidsOfSpecialProduct($spro_id,$start_record,$record_per_page);
?>
<?php
    while($bid = mysql_fetch_array($bids)){
?>
        <div class="comment-block-wrapper">
            <div class="comment-block">
                <div class="comment-block-header">
                    <div>
                    <?php
                        $user = findUserById($bid["USER_ID"]);
                        $userInfo = mysql_fetch_array($user);
                        echo $userInfo["USER_FULLNAME"];
                    ?>
                    </div>
                    <div>
                    <?php
                        $creationDate = new DateTime($bid["COM_CREATIONDATE"]);
                        echo $creationDate->format('H:i d/m/Y ');                                              
                    ?>                                            
                    </div>
                </div>
                <div class="comment-content">
                    <?php
                        echo $bid["COM_CONTENT"];                                            
                    ?>
                </div>
            </div>
        <!--Reply-->
        <?php  
                echo "</div>";
                echo "<div id='div_".$bid["COM_ID"]."' style='display:none'>";
                echo "<textarea class='comment' id='txt_".$bid["COM_ID"]."' name='txt_".$bid["COM_ID"]."'></textarea>";
                echo "</div>";
        
        ?>
        </div>
        <?php
            }
        ?>
         
